package com.coldtech.circlecrash;

import java.awt.Color;
import java.util.ArrayList;
import java.util.List;

import com.coldtech.circlecrash.units.MotherUnit;
import com.coldtech.circlecrash.units.SmallUnit;
import com.coldtech.circlecrash.units.Unit;

public class Player {
	private int x, y;
	private CircleCrash game = null;
	private Unit mother = null;
	private List<Unit> units = null;
	private Color color = null;

	public Player(CircleCrash game, int x, int y, Color color) {
		this.game = game;
		this.x = x;
		this.y = y;
		this.color = color;
		this.units = new ArrayList<Unit>();
		this.mother = (Unit) new MotherUnit(game.getUnitHandler(), this,
				this.x, this.y);
		this.mother.setColor(color);
		this.units.add(this.mother);
	}

	public Unit addUnit(int x, int y) {
		Unit unit = (Unit) new SmallUnit(game.getUnitHandler(), this, x, y, 15);
		unit.setColor(color);
		units.add(unit);
		return unit;
	}

	public Unit getMotherUnit() {
		return mother;
	}

	public List<Unit> getUnits() {
		return this.units;
	}
}
